<script setup lang="ts">
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import {useSettingsStore} from "@/store/modules/settings";

const buttonConfig = reactive({
  autoInsertSpace: true,
})

// 做一些初始化的事情
// 初始化项目的间距
function setCardMargin() {
  const settingsStore = useSettingsStore()
  const marginEmValue = settingsStore.cardMargin / 16
  const radiusEmValue = settingsStore.cardRadius / 16
  document.documentElement.style.setProperty('--my-card-margin', marginEmValue + 'em')
  document.documentElement.style.setProperty('--el-card-border-radius', radiusEmValue + 'em')
}

onMounted(() => {
  setCardMargin()
})
</script>
<template>
  <el-config-provider :button="buttonConfig" :locale="zhCn">
    <router-view/>
  </el-config-provider>
</template>